package com.learncloud.controller;

import com.learncloud.serviceFeign.TestFeignService;
import com.learncloud.serviceFeign.TestFeignZuulService;
import com.learncloud.serviceFeign.TestRibbonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhong on 2018/4/10.
 */
@RefreshScope
@RestController
public class Test {

    @Autowired
    TestFeignService service;

    @Autowired
    TestRibbonService ribbonService;

    @Autowired
    TestFeignZuulService feignZuulService;

    @Value("${foo}")
    String username;

    @PostMapping("test")
    String testFeign(){
        return service.test();
    }

    @PostMapping("testRibbon")
    String testRibbon(){
        return ribbonService.test();
    }

    @PostMapping("testFeignZuul")
    String testFeignZuul(){
        return feignZuulService.test();
    }

    @PostMapping("testConfig")
    String testConfig(){
        return username;
    }
}
